import { createSlice } from "@reduxjs/toolkit";
import { string } from "prop-types";
let store = createSlice({
    name: "num",
    initialState: {
        num: 0,
        arr:[1,2,3],
        list:[1,2,2],
        item:{},//预约记录跳详情
        options1: [
            {
                value: '一室',
                label: '一室',
                children: [
                    {
                        value: '一厅',
                        label: '一厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                    {
                        value: '两厅',
                        label: '两厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                ],
            },
            {
                value: '两室',
                label: '两室',
                children: [
                    {
                        value: '一厅',
                        label: '一厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                    {
                        value: '两厅',
                        label: '两厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                ],
            },
            {
                value: '三室',
                label: '三室',
                children: [
                    {
                        value: '一厅',
                        label: '一厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                    {
                        value: '两厅',
                        label: '两厅',
                        children: [
                            {
                                value: '一卫',
                                label: '一卫',
                            },
                            {
                                value: '两卫',
                                label: '两卫',
                            }
                        ],
                    },
                ],
            },
        ],





    },

    reducers: {
        add(state, action) {
            state.num = action.payload
        },
        toitem(state, action) {
            state.item = action.payload
        }
        
    }
})
export const { add,toitem } = store.actions;
export default store;